-
Notifications
You must be signed in to change notification settings - Fork 267
feat(stylus) - initialize and update fees for pyth contract #2795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…parsed information actually makes sense
…pdate all price feeds
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…pdate all price feeds. some cargo build errors, but will fix in next commit
- Modified get_current_timestamp to use MockClock::time().as_secs() in test mode - Added MockClock::set_time(Duration::from_secs(1761573860)) to three specific tests: - test_get_price_no_older_than_with_random_id_reverts_with_price_unavailable - test_get_price_no_older_than_where_update_younger_than_max_age_returns_price - test_get_price_no_older_than_reverts_too_old - Contract functionality unchanged (still uses block_timestamp in production) - All specified tests pass with mocked timestamp Co-Authored-By: ayush.suresh@dourolabs.xyz <byteSlayer31037@gmail.com>
- Added #[cfg(test)] to all 9 functions in test_data.rs: - good_update1() - good_update2() - multiple_updates_same_vaa() - multiple_updates_diff_vaa() - multiple_updates_diff_vaa_results() - good_update1_results() - multiple_updates_results() - good_update2_results() - current_guardians() - Ensures test data functions are only compiled during testing - All tests continue to pass with cfg(test) attributes Co-Authored-By: ayush.suresh@dourolabs.xyz <byteSlayer31037@gmail.com>
wormhole_contract: Contract<WormholeContract>, | ||
alice: Address, | ||
) { | ||
MockClock::set_time(Duration::from_secs(1761573860)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this timestamp is less than good_update2().timestamp + 1s? would be good to clarify the test setup in a comment
governance_emitter_chain_id: u16, | ||
governance_emitter_address: [u8; 32], | ||
governance_initial_sequence: u64, | ||
_data: Vec<u8>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this?
Summary
Implementing the necessary initialization and update functions for the pyth contract stylus implementation.
Rationale
These functions are the backbone of the contract.
How has this been tested?
Will be able to implement unit tests on this contract once these changes are done. Initial tests will be conducted through standard cargo test functionality, but then additional tests conducted through change are also possible through features of the stylus framework.